﻿@*
    For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@{
    Layout = null;
}
<link href="~/lib/layui/css/layui.css" rel="stylesheet" />
<script src="~/lib/layui/layui.js"></script>
<script src="~/js/js.cookie.js"></script>
<script src="~/js/moment.js"></script>
<script src="~/lib/jquery/dist/jquery.js"></script>

<!DOCTYPE html>
<html>
@* <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Demo</title>
    <!-- 请勿在项目正式环境中引用该 layui.css 地址 -->
    <link href="//unpkg.com/layui@2.9.18/dist/css/layui.css" rel="stylesheet">
</head> *@
<body>
    <form class="layui-form" action="">
        <div class="layui-form-item">
            <div class="layui-form-item">


                <div class="layui-form-item">


                    <label class="layui-form-label">所属单位:    宏光养羊</label>


                    <label class="layui-form-label">所属市场:</label>
                    <div class="layui-input-inline layui-input-wrap">
                        <select id="">
                            <option value="">请选择</option>
                            <option value="华南市场部">华南市场部</option>
                            <option value="华北市场部">华北市场部</option>
                            <option value="海外市场部">海外市场部</option>
                        </select>
                    </div>

                    

                    
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">业务员:</label>
                    <div class="layui-input-inline layui-input-wrap">
                        <input type="text" id="" lay-verify="required" autocomplete="off" lay-reqtext="请输入用户名" lay-affix="clear" class="layui-input demo-phone">
                    </div>

                    <label class="layui-form-label">是否默认:</label>
                    <div class="layui-input-inline layui-input-wrap">
                        <input type="radio" name="" value="是" title="是">
                        <input type="radio" name="" value="否" title="否">
                    </div>
                </div>


               


            </div>

            <div class="layui-form-item">
                <button type="button" class="layui-btn" lay-submit lay-filter="demo1">保存</button>

            </div>
        </div>
    </form>

    <!-- 请勿在项目正式环境中引用该 layui.js 地址 -->
   @*  <script src="//unpkg.com/layui@2.9.18/dist/layui.js"></script> *@
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=rp5j6DYVV8tDQoOMrbQgAFxrAwnKvcWM"></script>
</body>

</html>

<script>
    layui.use(function () {
        var form = layui.form;
        var layer = layui.layer;;


        form.on('submit(demo1)', function (d) {
            var data = {
                bankaccountName: $("#bankaccountName").val(),
                bank: $("#bank").val(),
                bName: $("#bName").val(),
                baccountPhone: $("#baccountPhone").val(),
                bphone: $("#bphone").val(),
                bType: $("[name=bType]:checked").val(),
                bCard: $("#bCard").val(),
                battribute: $("[name=battribute]:checked").val(),
                brelationship: $("#brelationship").val(),
                bremark: $("#bremark").val(),
            }

            $.ajax({
                url: "http://localhost:5269/api/Vendor/CreateBankaccount",
                type: 'post',
                data: JSON.stringify(data),
                dataType: "json",
                contentType: "application/json",
                success: res => {
                    if (res.code == 0) {
                        layer.msg('添加成功')
                    }
                    else {
                        layer.msg('保存失败')
                    }
                }
            })
            return false; // 阻止默认 form 跳转
        });





    });


    
</script>
